Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--com.pacist.diamonds.Book
Field Summary | |
int | bottomMargin
Margin between components in pages. |
java.awt.Component | currentPage
Currently active page. |
DrawnButton | currentTab
Currently active tab. |
DrawnButton | firstBottom
Reference to first tab. |
DrawnButton | firstLeft
Reference to first tab. |
DrawnButton | firstRight
Reference to first tab. |
DrawnButton | firstTop
Reference to first tab. |
int | height
Height of book. |
int | hGap
Horizontal space left between components. |
int | leftMargin
Margin between components in pages. |
int | pageHeight
Height of page. |
java.util.Hashtable | pageMap
Where all pages are kept. |
int | pageWidth
Width of page. |
int | rightMargin
Margin between components in pages. |
int | topMargin
Margin between components in pages. |
int | vGap
Vertical space left between components. |
int | width
Width of book. |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
Book()
Creates and initializes a new Book component. |
|
Book(int hGap,
int vGap)
Creates and initializes a new Book component, with specified horizontal and vertical gaps. |
Method Summary | |
void | actionPerformed(java.awt.event.ActionEvent event)
Method that is called when a Tab is clicked on. |
void | addBookListener(BookListener l)
Adds the specified Book listener to receive Book events from this Book. |
void | addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Adds the specified component to the layout. |
void | addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Adds the specified component to the layout. |
java.awt.Component | addPage(java.awt.Component page)
This method adds a Page to the Book. |
java.awt.Component | addTab(DrawnButton button,
java.awt.Component page)
This method adds a Tab and Page to the Book. |
java.awt.Component | addTab(DrawnButton button,
java.awt.Component page,
int pos)
This method adds a Tab and Page to the Book at a certain position. |
void | calcSizes(java.awt.Container target,
boolean preferred,
boolean arrowCheck)
Calculates the margins based on the width and height of the tab buttons. |
void | fireBookEvent(BookEvent event)
Processes book events occurring on this Book by dispatching them to any registered BookListener objects. |
void | firePageTurnedEvent(java.awt.Component oldPage,
java.awt.Component newPage)
This method notifies all Book listeners that the Page has been changed. |
java.util.Vector | getBookListeners()
Returns a Vector of all Book listeners. |
DrawnButton | getCurrentTab()
Returns a reference to the Tab which is currently selected. |
float | getLayoutAlignmentX(java.awt.Container target)
Returns the alignment along the x axis. |
float | getLayoutAlignmentY(java.awt.Container target)
Returns the alignment along the y axis. |
void | invalidateLayout(java.awt.Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
void | layoutContainer(java.awt.Container target)
Lays out the container. |
java.awt.Dimension | maximumLayoutSize(java.awt.Container target)
Returns the maximum size of this component. |
java.awt.Dimension | minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions needed to layout the components contained in the specified target container. |
void | moveAllTabs(int pos)
Moves all Tabs to a different position. |
void | paint(java.awt.Graphics g)
This method is called to repaint the Book. |
java.awt.Dimension | preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout given the components in the specified target container. |
void | removeBookListener(BookListener l)
Removes the specified Book listener so that it no longer receives BookEvents from this Book. |
void | removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout. |
void | setCurrentTab(DrawnButton button)
Sets the currently selected Tab to the DrawnButton specified. |
void | setTabPosition(DrawnButton b,
int pos)
Moves a Tab to a different position. |
void | showPage(DrawnButton button)
Shows the Page referenced by a specific Tab. |
int | tabPosition(DrawnButton tab)
Returns the position of a Tab. |
Methods inherited from class java.awt.Panel | |
addNotify |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected DrawnButton currentTab
protected java.awt.Component currentPage
protected int hGap
protected int vGap
protected int leftMargin
protected int rightMargin
protected int topMargin
protected int bottomMargin
protected int pageWidth
protected int pageHeight
protected int width
protected int height
protected java.util.Hashtable pageMap
protected DrawnButton firstTop
protected DrawnButton firstBottom
protected DrawnButton firstLeft
protected DrawnButton firstRight
Constructor Detail |
public Book()
public Book(int hGap, int vGap)
hGap
- Horizontal gap.
vGap
- Vertical gap.Method Detail |
public java.awt.Component addTab(DrawnButton button, java.awt.Component page)
button
- the DrawnButton which will act as the Tab; usually this will be a FlexiButton.
page
- the Component which will act as the Page; usually a Panel.public java.awt.Component addTab(DrawnButton button, java.awt.Component page, int pos)
button
- the DrawnButton which will act as the Tab; usually this will be a FlexiButton.
page
- the Component which will act as the Page; usually a Panel.
pos
- the position of the Page.public java.awt.Component addPage(java.awt.Component page)
page
- the Component which will act as the Page; usually a Panel.public void moveAllTabs(int pos)
pos
- the position of the Tabs.public void setTabPosition(DrawnButton b, int pos)
pos
- the new position of the Tab.public DrawnButton getCurrentTab()
public void setCurrentTab(DrawnButton button)
button
- the Tab to make current.public void showPage(DrawnButton button)
button
- the Tab which refers to a specific page.public void actionPerformed(java.awt.event.ActionEvent event)
event
- the event details.public void paint(java.awt.Graphics g)
g
- the graphics context to use for painting.public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
name
- the name of the component
comp
- the the component to be addedpublic void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
comp
- the Tab to add.
contraints
- the Page to add.public void removeLayoutComponent(java.awt.Component comp)
comp
- the component to remove.public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
target
- the component which needs to be laid out.public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
target
- the component which needs to be laid out.public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
public float getLayoutAlignmentX(java.awt.Container target)
public float getLayoutAlignmentY(java.awt.Container target)
public void invalidateLayout(java.awt.Container target)
protected int tabPosition(DrawnButton tab)
tab
- the Tab we are interested in.protected void calcSizes(java.awt.Container target, boolean preferred, boolean arrowCheck)
target
- the specified component being laid out.
preferred
- TRUE - use preferredSize(). FALSE - use minimumSize().public void layoutContainer(java.awt.Container target)
target
- the specified component being laid out.protected void firePageTurnedEvent(java.awt.Component oldPage, java.awt.Component newPage)
oldPage
- the previously selected Page.
newPage
- the new currently selected Page.protected java.util.Vector getBookListeners()
public void addBookListener(BookListener l)
public void removeBookListener(BookListener l)
protected void fireBookEvent(BookEvent event)
Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |